package com.yhgm.mapper;

import com.yhgm.model.entity.SystemLog;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;

import java.util.List;

public interface SystemLogDao {
    @Delete("delete from system_log")
    Integer clear();

    List<SystemLog> findAll(Integer code, String msg, Integer page, Integer size);

    Integer count(Integer code,String msg);

    @Insert("insert into system_log (id, event_time, request_url, error_msg) values (null,#{eventTime},#{requestUrl},#{errorMsg})")
    Integer addOne(SystemLog SystemLog);
    @Delete("delete from system_log where event_time<(select date_sub(now(),interval 3 month))")
    Integer clearThreeMonth();
}
